<?php if(!isset($this->data['Cashier']['id'])){ ?>
<tr>
    <th valign="top">Cashier Id</th>
    <td>
        <script type="text/javascript">
            $(document).ready(function(){
                generate_code(); 
            });
            function generate_code(){
                var ret = "";
                for(i=1;i<=8;i++){
                    ret = ret + "" +Math.floor(Math.random() * 10);
                }
                $('#cashierId').val(ret);
                return false;
            }
        </script>
        <?php
            echo $this->Form->input('cashier_id', array(
                'label'     => false,
                'div'       => false,
                'type'      =>'text',
                'onkeypress'=>"return false",
                "id"        =>'cashierId',
                'class'     => 'inp-form med')
            );     
        ?>    
        <?php echo $this->Html->link("Generate code","#",array('class'=>'button','onclick'=>"return generate_code()")) ?>
    </td>
    <td>
    </td> 
</tr>
<?php }
?>
<tr>
    <th valign="top">Store branch</th>
    <td>
        <?php
            echo $this->Form->input('store_branch', array(
                                'label'     => false,
                                'div'       => false,
                                'class'     => 'inp-form med')
                );     
        ?>      
    </td>
    <td></td> 
</tr>
<tr>
    <th valign="top">Name</th>
    <td>
        <?php
            echo $this->Form->input('name', array(
                                'label'     => false,
                                'div'       => false,
                                'class'     => 'inp-form med')
                );     
        ?>      
    </td>
    <td></td> 
</tr>
<?php
if(!isset($this->data['Cashier']['id'])){ ?>
<tr>
    <th valign="top">Password </th>
    <td>
        <?php
            echo $this->Form->input('password', array(
                                'label'     => false,
                                'div'       => false,
                                'value'     =>'',
                                'class'     => 'inp-form med')
                );     
        ?>      
    </td>
    <td></td> 
</tr>
<tr>
    <th valign="top">Confirm Password </th>
    <td>
        <?php
            echo $this->Form->input('confirmPassword', array(
                                'label'     => false,
                                'div'       => false,
                                'type'      =>'password',
                                'class'     => 'inp-form med')
                );     
        ?>      
    </td>
    <td></td> 
</tr>
<?php }
?>

<tr>
    <th valign="top">Family name</th>
    <td>
        <?php
            echo $this->Form->input('family_name', array(
                                'label'     => false,
                                'div'       => false,
                                'class'     => 'inp-form med')
                );     
        ?>      
    </td>
    <td></td> 
</tr>
<tr>
    <th valign="top">Working days</th>
    <td>
        <ul class="interest_list">
            <?php
            if(!isset($interested)){
                $interested = array();
            }
            foreach ($interests as $id=>$value) { ?>
            <li><input type="checkbox" name="data[Cashier][working_days][]" <?php if(in_array($id, $interested)){ ?> checked="true" <?php } ?> value="<?=$id?>" /> <label><?=$value?></label> </li>
        <?php }     
        ?>
        </ul> 
    </td>
    <td></td> 
</tr>
<tr>
    <th valign="top">Working Time</th>
    <td>
        <script type="text/javascript">
            $(document).ready(function(data){
                $('#time_start, #time_end').calendricalTimeRange({
                        'isoTime':"ios"
                    }
                );
            });
        </script>
         <?php
            echo $this->Form->input('hour_from', array(
                                'label'     => false,
                                'div'       => false,
                                'onkeypress'=>"return false",
                                'id'        =>"time_start",
                                'style'     =>"width:100px",
                                'class'     => 'input-form med')
                );     
        ?>  -  <?php
            echo $this->Form->input('hour_to', array(
                                'label'     => false,
                                'div'       => false,
                                'onkeypress'=>"return false",
                                'id'        =>"time_end",
                                'style'     =>"width:100px",
                                'class'     => 'input-form med')
                );     
        ?>
    </td>
    <td></td> 
</tr>
<tr>
    <th valign="top">Active:</th>
    <td>	
        <?php
            echo $this->Form->checkbox('status', 
                array('1' => 'Active', '0' => 'Inactive'),
                array("legend" => false,
                      'value'  => isset($this->data[$sN]['status'])&&($this->data[$sN]['status'] != '') ? $this->data[$sN]['status'] : 1,
                )
            );
        ?>
    </td>
    <td></td>
</tr> 
